package com.bee.beeAuth.controller;

import com.bee.beeAuth.feign.BeeLoveService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 测试controller
 * @description:
 * @author: chenguosong
 * @date: 2022-11-25 08:19
 */
@RestController
public class Test2Controller {
    @Resource
    private BeeLoveService beeLoveService;

    @GetMapping("/test2")
    public String test2(){
        return "此服务远程调用beeLove"+beeLoveService.test().getName();
    }
    @PreAuthorize("hasAnyAuthority('sys:user:test')")
    @GetMapping("/test1")
    public String test1(){
        return "此服务自带需[sys:user:test] 权限";
    }

    @GetMapping("/test")
    public String test(){
        return "此服务自带无鉴权";
    }
}
